<template>
  <div>
    <van-cell-group>
      <van-cell title="品牌方直购" is-link value="更多品牌商" />
    </van-cell-group>
    <!-- <van-grid :column-num="2">
      <van-grid-item
        v-for="item in brandList"
        :key="item.id"
        :icon="item.picUrl"
        :text="item.name"
      />
    </van-grid> -->
    <div class="grid-list">
      <div class="grid-item" v-for="item in brandList" :key="item.id">
        <div class="brand-img">
          <img :src="item.picUrl" alt="" />
        </div>
        <div class="brand-name">
          <p>{{ item.name }}</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { defineProps } from "vue";
const props = defineProps({
  brandList: {
    type: Array,
    default: () => [],
  },
});
</script>

<style scoped lang="scss">
.grid-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 每行 2 列，平均分配宽度 */
  grid-gap: 20px; /* 网格项之间的间距，行列间距一致 */
  background-color: white;
  padding: 20px 0;
}
.grid-item {
  box-sizing: border-box;
}
.brand-img {
  width: 100%;
}
.brand-img img {
  margin: 20px auto;
  width: 80%;
  height: auto;
  display: block;
}
.brand-name {
  text-align: center;
  margin-top: 8px;
}
.brand-name p {
  margin: 0;
  font-size: 40px;
  color: #333;
}
</style>
